<template>
  <div class="h5-wrapper">
    <div class="content">
      <!-- 二级路由出口, -->
      <RouterView></RouterView>
    </div>
    <nav class="tabbar">
      <!-- 导航高亮
           1. 将a标签，替换成router-link (to)
           2. 结合高亮类名实现高亮效果 (router-link-active 模糊匹配)
      -->
      <RouterLink to="/article" active-class="active">面经</RouterLink>
      <RouterLink to="/collect" active-class="active">收藏</RouterLink>
      <RouterLink to="/like" active-class="active">喜欢</RouterLink>
      <RouterLink to="/user" active-class="active">我的</RouterLink>
    </nav>
  </div>
</template>

<script setup lang="ts">
import {RouterView, RouterLink} from "vue-router";
</script>

<style>
body {
  margin: 0;
  padding: 0;
}
</style>
<style lang="scss" scoped>
.h5-wrapper {
  .content {
    margin-bottom: 51px;
  }
  .tabbar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    display: flex;
    background: #fff;
    border-top: 1px solid #e4e4e4;
    a {
      flex: 1;
      text-decoration: none;
      font-size: 14px;
      color: #333;
      -webkit-tap-highlight-color: transparent;
    }
    .active {
      color: orange;
    }
  }
}
</style>
